package com.caosy.grassthinkremote.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;
import java.util.HashMap;

@Data
@TableName("deliver")
public class Deliver {
    /**
     * 主键
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 公司名称
     */
    private String enterpriseName;

    /**
     * 进度，0投递，1笔试，2面试，3oc，4offer，5挂
     */
    private Integer status;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    public enum DeliverStatusEnum {
        DELIVER(0,"投递"),
        WRITTEN_EXAMINATION(1,"笔试"),
        INTERVIEW(2,"面试"),
        OC(3,"OC"),
        OFFER(4,"offer"),
        PASS(5,"挂");

        public Integer status;
        public String desc;

        public static HashMap<Integer,String> statusToDesc = new HashMap<>(8);

        DeliverStatusEnum(Integer status,String desc) {
            this.status = status;
            this.desc = desc;
        }

        static {
            for (DeliverStatusEnum e : DeliverStatusEnum.values()) {
                statusToDesc.put(e.status,e.desc);
            }
        }

    }
}
